package com.ruoyi.ai_config.domain.dto;

import java.math.BigDecimal;
import java.time.LocalDate;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import io.swagger.v3.oas.annotations.media.Schema;

/**
 * AI任务配置与参数组合DTO，生成文章类
 * 用于业务逻辑中需要同时使用配置和参数的场景
 *
 * @author lzk
 * @date 2025-06-27
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "AI任务配置与参数组合DTO，生成文章类")
public class TextTaskConfigWithParamsDTO {

    @Schema(title = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Schema(title = "配置名称")
    private String configName;

    @Schema(title = "任务类型")
    private String taskType;

    @Schema(title = "配置描述")
    private String description;

    @Schema(title = "是否启用")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long isActive;

    @Schema(title = "虚构级别")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long fictionLevel;

    @Schema(title = "虚构比例")
    private BigDecimal fictionRatio;

    @Schema(title = "目标长度")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long targetLength;

    @Schema(title = "风格类型")
    private String styleType;

    @Schema(title = "风格描述")
    private String styleDescription;

    @Schema(title = "提示词模板")
    private String promptTemplate;

    @Schema(title = "模板变量")
    private String templateVariables;

//    /**
//     * 从基础配置创建DTO
//     */
//    public static TextTaskConfigWithParamsDTO fromBaseConfig(Long id, String configName, String taskType) {
//        return TextTaskConfigWithParamsDTO.builder()
//                .id(id)
//                .configName(configName)
//                .taskType(taskType)
//                .build();
//    }
//
//    /**
//     * 设置参数信息
//     */
//    public TextTaskConfigWithParamsDTO withParams(Long fictionLevel, BigDecimal fictionRatio,
//                                                  Long targetLength, String styleType, String styleDescription) {
//        this.fictionLevel = fictionLevel;
//        this.fictionRatio = fictionRatio;
//        this.targetLength = targetLength;
//        this.styleType = styleType;
//        this.styleDescription = styleDescription;
//        return this;
//    }
//
//    /**
//     * 设置模板信息
//     */
//    public TextTaskConfigWithParamsDTO withTemplate(String promptTemplate, String templateVariables) {
//        this.promptTemplate = promptTemplate;
//        this.templateVariables = templateVariables;
//        return this;
//    }
}